package org.example.JVM.MemoryStructure;

import java.io.IOException;

/**
 * @description:
 * @author: farprt
 * @create: 2022-11-12 14:35
 **/
public class StackOverFlow {

    private static volatile int value = 0;

    public static int sigma(int n) {
        value = n;
        System.out.println("current n value is" + n);
        return n + sigma(n + 1);
    }

    public static void main(String[] args) throws IOException {
        new Thread(() -> {
            sigma(1);
        }).start();
        System.in.read();
        System.out.println(value);
    }
}